{ Класс описатель поля данных объекта

  Module is a part of project http://code.google.com/p/drivers-training-request
  Copyright (C) 2012 Leonid Vlasov leoniv@bk.ru

  This source is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free
  Software Foundation; either version 2 of the License, or (at your option)
  any later version.

  This code is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.

  A copy of the GNU General Public License is available on the World Wide Web
  at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
  to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  MA 02111-1307, USA.
}
{ TFieldDescriptor }
TFieldDescriptor = Class(TFieldDescPattern)
protected
  FName:String;
  FCaption:String;
  function DateTimeToISODateTimeString(D:TDateTime):String;
  function DateTimeToLocalDateTimeString(D:TDateTime):String;
  function LocalDateTimeStringToDateTime(S:String):TDateTime;
  Procedure Normalize(Var Value:String);
  function GetContext(Value:String):String;overload;
  function GetContext(Value:TDataSetField):String;overload;
  function GetContext(Value:TDOMElement):String;overload;
  function XmlQName():string;
  //Валидация значения
  function ValidateEditMask(Const Value:String; Var Couse:string):Boolean;
  function Validate(Var Value:String; Var Couse:string):Boolean;
  //Конвертация
  function ToXMLString(Value:String):String;
  function ToXMLNode(Const XMLDoc:TXMLDocument;Value:String):TDOMElement;
  function ToSQLString(Value:String):String;
  function FromXMLNode(Node:TDOMElement):String;
  function FromSQLFildVAlue(Const SQLVAlue:TDataSetField):String;
  constructor Create(AType: TBaseFieldType);Override;
public
    constructor Create(AName, ACAption: String;AType: TBaseFieldType);
    constructor Create(AName,ACAption:String;Pattern:TFieldDescPattern);//Создание по шаблону
    property Name:String read FName;
    property Caption:String read FCaption;
    function SelectSqlStr():String;
end;

//PTFieldDescriptor = ^TFieldDescriptor;
